package com.tjsinfo.tjsoa.mail.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.mail.bo.ITjsmailBo;

/**
 * 发件箱邮件移动
 * @author wangxiaowei
 *
 */
public class EmailMoveAction extends Action{
	private ITjsmailBo tjsmailBo;
	public ITjsmailBo getTjsmailBo() {
		return tjsmailBo;
	}
	public void setTjsmailBo(ITjsmailBo tjsmailBo) {
		this.tjsmailBo = tjsmailBo;
	}
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		String[] strarray = request.getParameterValues("checkbox2");//邮件数组
		if(tjsmailBo.moveTjsmail(strarray, request.getParameter("foldid"))) {
			request.setAttribute("linkurl", "tjsinfo/tjsoa/mail/selectEmaiList.do");
			request.setAttribute("message", "email.message.movemail");
			return mapping.findForward("success");
			
		} else {
			return mapping.findForward("error");
		}
	}
}
